/* 
 * File:   SockStreamAsincronico.h
 * Author: max
 *
 * Created on June 1, 2013, 3:06 PM
 */

#ifndef SOCKSTREAMASINCRONICO_H
#define	SOCKSTREAMASINCRONICO_H

#include <string>
#include "common_Excepcion.h"
#include "server_SockStream.h"
#include "server_SockEndPointAsincronico.h"

using namespace std;
using namespace TP;
using namespace TP::Comunicacion;

namespace TP { namespace Comunicacion { namespace Asincronica {

class SockStreamAsincronico {

public:

    SockStreamAsincronico();
    
    SockStreamAsincronico(int pDomain, int pProtocol);

    virtual ~SockStreamAsincronico();
    
    void Iniciar () throw (Excepcion&);
    
    void Finalizar() throw (Excepcion&);
    
    void Bind(string& pPuerto, uint32_t pInAddr) throw (Excepcion&);
    
    void Listen(int pQueueLength) throw (Excepcion&);
    
    SockEndPointAsincronico* Acept () throw (Excepcion&);
    
private:
    SockStream* _socket;
};

}}}

#endif	/* SOCKSTREAMASINCRONICO_H */

